<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>创建类和对象</title>
		<script type="text/javascript">
			//创建类
			class Star {
				constructor(username,age) {
					this.username = username;
					this.age = age;
				}
				say(song) {
					console.log(song)
				}
			}
			//创建Star类的实例对象
			var ldh = new Star('刘德华',18);
			console.log(ldh.age + ldh.username);
			ldh.say('冰雨');
			
		</script>
	</head>
	<body>
	</body>
</html>
